# Python生成器详解
def intNum():
    print("开始执行")
    for i in range(5):
        yield i
        print("继续执行")

num = intNum()

# 调用 next() 内置函数
print(next(num))
print()
# 调用 __next__() 方法
print(num.__next__())
print()
print("****************")

# 通过 for 循环遍历生成器
for i in num:
    print(i)

print()

num = intNum()
print(list(num))

print()

num = intNum()
print(tuple(num))
